package xddq

import (
	"fmt"
	"time"
	D "websocket_apn/define"
	"websocket_apn/proto"
)

func (xd *XdDriver) CheckYaoMenMsgInfoData(allMsg []D.MsgYaoMen) {
	xd.waitForStartSendCmd()
	for _, msg := range allMsg {
		if msg.ID == xd.UserData.UserID {
			continue
		} else if msg.Type == D.Msg_Type_Xian_Ju {
			xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_YARDPB_TREE_HELP, fmt.Sprintf("08%s", msg.ID)))
		} else if msg.Type == D.Msg_Type_YM_Master {
			//镇压妖兽协助
			xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_UNION_BOUNTY_MANAGE_TEAM, fmt.Sprintf("8010%s", msg.ID)))
		} else if msg.Type == D.Msg_Type_YMDB {
			//赠送幻卷
			xd.Send(proto.Get_Cmd_Data(xd.userInfo.PlayerId, proto.S_UNION_TREASURE_SEND_CHIP, fmt.Sprintf("08%s10%s", msg.ID, msg.Msg)))
		}
		time.Sleep(time.Second)
	}
}
